package com.le.boot2.dao.impl;

import com.le.boot2.dao.UserDao;
import com.le.boot2.model.User;
import com.le.boot2.model.UserRowMapper;
import lombok.AllArgsConstructor;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
@AllArgsConstructor
public class UserDaoImpl implements UserDao {
    JdbcTemplate jdbcTemplate;
    @Override
    public List<User> list() {
        return jdbcTemplate.query("select * from user",new UserRowMapper());
    }
}
